<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title><{:C('web_site_name')}>---后台管理</title>
    <link rel="stylesheet" type="text/css" href="<?php echo APP_TMPL_PATH ; ?>/static/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo APP_TMPL_PATH ; ?>/static/css/main.css"/>

    <script type="text/javascript" src="<?php echo APP_TMPL_PATH ; ?>/static/js/jquery.js"></script>
    
    <script type="text/javascript" src="<?php echo APP_TMPL_PATH ; ?>/static/js/layer/lib.js"></script>
<script type="text/javascript" src="<?php echo APP_TMPL_PATH ; ?>/static/js/layer/layer.min.js"></script>

</head>
<body>
<div class="topbar-wrap white" style="height:100px">
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <h1 class="topbar-logo"><img src="<?php echo APP_TMPL_PATH ; ?>/static/images/logo.png"></h1>
            <ul class="navbar-list clearfix">
            <?php 
                $first_top_id =  0 ;
                $first_top_name = '' ;
                
                foreach($nav_list as $top_key => $top_val){
                    if(!in_array($top_val['url'] , $url_data) && !$super_admin){
                        continue;
                    }
                    $class = '' ;
                    if($top_key == 0 ){
                        $first_top_id = $top_val['id'];
                        $first_top_name =$top_val['name'];
                        $class = "class='on'";
                    }
            ?>
                <li  attr-id="<?php echo $top_val['id'] ;?>" attr-name="<?php echo $top_val['name'];?>">
                
                
                <a <?php echo $class ;?> href="javascript:void(0)">
                <img title="工作台" src="<?php echo APP_TMPL_PATH ; ?>/static/images/icon01.png">
               <h2> <?php echo $top_val['name'];?></h2>
                
                </a>
                </li>
                
                <?php } ?>
            </ul>
        </div>
        <div class="top-info-wrap">
            <ul class="top-info-list clearfix">
           
            <li>&nbsp;&nbsp;&nbsp;所在组:<?php echo $group_name ;?></li>
                <li><a href="javascript:void(0)" onclick="edit_pwd()">修改密码</a></li>
                <li><a href="javascript:void(0)" onclick='login_out()'>退出</a></li>
            </ul>
            <div class="user">
                <span><?php echo $username ;?></span>
                <i>消息</i>
                <b>5</b>
            </div>
        </div>
    </div>
</div>

</body>

</html>
<script>
    $(function(){
        
        $(".top").each(function(){
            $(this).click(function(){
                $(this).siblings(".sub-menu").toggle("slow");
            });
        });
        $(".navbar-list.clearfix li").each(function(){
            $(this).click(function(){
                
                var attr_id = $(this).attr("attr-id");
                var attr_name = $(this).attr("attr-name");
                parent.window.frames["leftFrame"].$("li[class^='top_']").hide();
                //$(".top_").hide();
                parent.window.frames["leftFrame"].$(".top_"+attr_id).show();
                parent.window.frames["leftFrame"].$(".sidebar-title h1").html(attr_name);
                $(".navbar-list.clearfix li a").removeClass("on");
                $(this).find("a").addClass("on");
            });
        });
        
    });
function switch_right(url,  o ){
    $("#iframepage").attr("src" , url );
    $(".sidebar-list a").removeClass();
    $(o).addClass("on");
}
function edit_pwd(){
	parent.window.frames["rightFrame"].$.layer({
        type: 2,
        shadeClose: true,
        title: "修改密码",
        closeBtn: [0, true],
        shade: [0.8, '#000'],
        border: [1],
        offset: ['20px',''],
        area: ['720px','460px'],
        iframe: {src: '<?php echo U("info/editpwd");?>'}
    }); 
}

function login_out(){
        parent.window.frames["rightFrame"].$.layer({
        shade: [1],
        area: ['240px','auto'],
        dialog: {
            msg: "是否确定安全退出",
            btns: 2,                    
            type: 4,
            btn: ['确定','取消'],
            yes: function(){
                parent.window.location.href="<{:U('login/login_out')}>" ; 
            }, no: function(){
                
            }
        }
    });
}

    
</script>